package com.cmcc.aregister.ui.dialog;

import android.content.Context;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.cmcc.aregister.R;
import com.cmcc.aregister.cs.model.DocInfoModel;
import com.cmcc.aregister.cs.model.Doctor;

public class DoctorInfoDialog extends MyDialog {
	private Button confirm;

	public DoctorInfoDialog(Context context, DocInfoModel docInfoModel) {
		super(context);
		setContentView(R.layout.dialog_other_doctor_info);
//		((LazyImageView) findViewById(R.id.dialog_image)).loadImage(
//				docInfoModel.photoUrl, 0, 1);
		((TextView) findViewById(R.id.dialog_title))
				.setText(docInfoModel.doctorname);
		((TextView) findViewById(R.id.dialog_unit_name))
				.setText(docInfoModel.title);
		((TextView) findViewById(R.id.dialog_professional_name))
				.setText(docInfoModel.outType);
		((TextView) findViewById(R.id.dialog_out_fee))
		.setText(docInfoModel.outFee + "元");
		((TextView) findViewById(R.id.dialog_introduction))
				.setText(docInfoModel.intro);
		((TextView) findViewById(R.id.dialog_introduction))
				.setMovementMethod(ScrollingMovementMethod.getInstance());
		confirm = (Button) findViewById(R.id.dialog_confirm_btn);

		confirm.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});
	}
	
	public DoctorInfoDialog(Context context, Doctor doctor) {
		super(context);
		setContentView(R.layout.dialog_doctor_info);
//		((LazyImageView) findViewById(R.id.dialog_image)).loadImage(
//				doctor.image, 0, 1);
		((TextView) findViewById(R.id.dialog_title))
				.setText(doctor.doctor_name);
		((TextView) findViewById(R.id.dialog_unit_name))
				.setText(doctor.unit_name);
		((TextView) findViewById(R.id.dialog_professional_name))
				.setText(doctor.dep_name);
		((TextView) findViewById(R.id.dialog_introduction))
				.setText(doctor.detail);
		((TextView) findViewById(R.id.dialog_introduction))
				.setMovementMethod(ScrollingMovementMethod.getInstance());
		confirm = (Button) findViewById(R.id.dialog_confirm_btn);

		confirm.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});
	}

	public void setCancelClickListener(View.OnClickListener onClickListener) {
		confirm.setOnClickListener(onClickListener);
	}
}
